package com.chain.BrotherExchange.ui.listener;

import android.view.View;

import com.chain.BrotherExchange.ui.activity.LoginActivity;
import com.chain.BrotherExchange.utils.Androids;

/**
 * 点击拦截登录
 */
public class LoginInterceptListener implements View.OnClickListener {

    private final View.OnClickListener mOnClickListener;

    public LoginInterceptListener(View.OnClickListener clickListener) {
        this.mOnClickListener = clickListener;
    }

    @Override
    public void onClick(View v) {
        if (Androids.LocalConfig.isLogin()) {
            mOnClickListener.onClick(v);
        } else {
            LoginActivity.launch(v.getContext());
        }
    }
}
